package com.example.imtoken.modules.private_import.backup

import android.content.Intent
import android.view.View
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.ClickUtils
import com.example.imtoken.R
import com.example.imtoken.core.base.BaseActivity
import com.example.imtoken.databinding.ActivityPrivateBackupBinding
import com.example.imtoken.modules.user.create.backups.mnemonic.MnemonicWordsActivity

class PrivateBackupActivity :
    BaseActivity<PrivateBackupViewModel, ActivityPrivateBackupBinding>(PrivateBackupViewModel::class.java) {

    private val mnemonic by lazy {
        intent.getStringExtra("mnemonic")
    }

    override fun initLayoutId(): Int {
        return R.layout.activity_private_backup
    }

    override fun init() {
        initTitle()
        initClick()
    }

    private fun initClick() {
        dataBinding.include15.ivHeadBack.setOnClickListener { this.finish() }
        ClickUtils.applyGlobalDebouncing(dataBinding.tvNext) {
            val intent = Intent(this, MnemonicWordsActivity::class.java)
            intent.putExtra("mnemonic", mnemonic)
            ActivityUtils.startActivity(intent)
            this.finish()
        }
    }

    private fun initTitle() {
        dataBinding.include15.vLine.visibility = View.INVISIBLE
    }
}